<!DOCTYPE html> 
<?php

header('Content-Type: text/html; charset=utf-8');

require ('../config/connexion_db.config.php');
include ('listeDeroulante.php');

if(isset($_GET['token'])){

 $requete = 'select * from users where token="'.$_GET['token'].'"';
 $resultat=$connexion->query($requete);

$tabResultat=$resultat->fetchAll(PDO::FETCH_ASSOC);


 
 }
?>
<!--html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"--> 

<head> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
	<title>Formulaire</title> 
	<link rel="stylesheet" href="../css/subscribe.css">

	<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui.js"></script>

	<script type="text/javascript" src="../js/verificationChamps.js"></script>


</head> 
<script type="text/javascript">
$(document).ready(function(){
	
	$('#page2').hide();
	$('#page3').hide();
	$('#bouton1').css('background-color','#FFA600')
	$('#bouton2').css('background-color','#F2DBAE')
	$('#bouton3').css('background-color','#F2DBAE')
	
	$("#next").click(function(){
	retour = VerifChamp();
	if(retour==true){
	$('#bouton1').css('background-color','#F2DBAE')
	$('#bouton2').css('background-color','#FFA600')
	$('#bouton3').css('background-color','#F2DBAE')
	}
	});

});	


		</script>
<body>       

<div class="boutonAvancement" id="bouton1">Information</div>
<div class="boutonAvancement" id="bouton2">Paiement</div>
<div class="boutonAvancement" id="bouton3">Terminer</div>


	<div id="page1">

		<p id='title'><center>CONGRES ASTROCYTES PARIS 2014</center></p>
		<form id='myForm' method="post" action="update_form.php">
		<input type="hidden" name='token' <?php echo 'value="'.$_GET['token'].'"'?> >
			<p><label for="titre">Title* : </label>
				<select name="titre" id="titre" >
					<option value="Mme" <?php if($tabResultat[0]['titre']=='Mme') echo 'selected';?>>Mrs</option>
					<option value="M." <?php if($tabResultat[0]['titre']=='M.') echo 'selected';?>>Mr</option>
					<option value="Pr."<?php if($tabResultat[0]['titre']=='Pr.') echo 'selected';?>>Pr.</option>
					<option value="Dr."<?php if($tabResultat[0]['titre']=='Dr.') echo 'selected';?>>Dr.</option>
				</select>
			</p>

			<p><label for="nom">Surname* : </label><input type="text" name="nom" id="nom" <?php echo 'value='.$tabResultat[0]['nom']?>></p>

			<p><label for="prenom">First name* :</label><input type="text" name="prenom" id="prenom" <?php echo 'value='.$tabResultat[0]['prenom']?>></p>

			<p><label for="initiale">Middle name initial :</label><input type="text" name="initiale" id="initiale" <?php echo 'value='.$tabResultat[0]['initiale']?>></p>

			<p><label for="genre">Gender(required for communication balance)* :</label>
				<label for="F">F</label><input type="radio" name="genre" value="F" id="F" <?php if($tabResultat[0]['genre']=='F') echo 'checked';?> />
				<label for="H">M</label><input type="radio" name="genre" value="H" id="H" <?php if($tabResultat[0]['genre']=='H') echo 'checked';?>/>
			</p>


			<!-- A test dans fct de test si email est correcte--> 

			<p><label for="email">E.mail address* :</label><input type="email" name="email" id="email" <?php echo 'value='.$tabResultat[0]['email']?> ></p>

			<p><label for="type_ins">Enrolment* :</label>
				<select name="type_ins" id="type_ins">
					<option value="Organisateur"  <?php if($tabResultat[0]['type_ins']=='Organisateur') echo 'selected';?> >Organizer</option>
					<option value="Président de séance" <?php if($tabResultat[0]['type_ins']=='Président de séance') echo 'selected';?>>Chair</option>
					<option value="Participant" <?php if($tabResultat[0]['type_ins']=='Participant') echo 'selected';?>>Participant</option>
				</select>
			</p>

			<p><label for="institution">Organisation* :</label><input type="text" name="institution" id="institution" <?php echo 'value='.$tabResultat[0]['institution']?> ></p>

			<p><label for="type_instit">Organisation category* :</label>
				<select name="type_instit" id="titre">
					<option value="Université" <?php if($tabResultat[0]['type_instit']=='Université') echo 'selected';?> >Academic</option>
					<option value="Recherche publique" <?php if($tabResultat[0]['type_instit']=='Recherche publique') echo 'selected';?>>Governmental research</option>
					<option value="Entreprise privée" <?php if($tabResultat[0]['type_instit']=='Entreprise privée') echo 'selected';?>>Corporate</option>
				</select>
			</p>

			<p><label for="laboratoire">Department/Laboratory* :</label><input type="text" name="laboratoire" id="laboratoire" <?php echo 'value='.$tabResultat[0]['laboratoire']?> ></p>

			<p><label for="statut">Position/Grade level* :</label>
				<select name="statut" id="statut">
					<option value="Professeur" <?php if($tabResultat[0]['statut']=='Professeur') echo 'selected';?> >Professor</option>
					<option value="Directeur de laboratoire" <?php if($tabResultat[0]['statut']=='Directeur de laboratoire') echo 'selected';?>>Research Head</option>
					<option value="Assistant" <?php if($tabResultat[0]['statut']=='Assistant') echo 'selected';?> >Assistant</option>
					<option value="Chercheur" <?php if($tabResultat[0]['statut']=='Chercheur') echo 'selected';?>>Researcher</option>
					<option value="Stagiaire post-Doctoral" <?php if($tabResultat[0]['statut']=='Stagiaire post-Doctoral') echo 'selected';?>>Post-Doct Fellow</option>
					<option value="Thésard" <?php if($tabResultat[0]['statut']=='Thésard') echo 'selected';?>>PhD</option>
					<option value="student" <?php if($tabResultat[0]['statut']=='student') echo 'selected';?>>Student</option>
					<option value="Mastère" <?php if($tabResultat[0]['statut']=='Mastère') echo 'selected';?>>Master</option>
					<option value="Licence" <?php if($tabResultat[0]['statut']=='Licence') echo 'selected';?>>Graduate</option>
				</select>
			</p>

			<p><label for="adresse">Adress(n°, street/lane, building...)* : </label><input type="text" name="adresse" id="adresse" <?php echo 'value='.$tabResultat[0]['adresse']?> ></p>

			<p><label for="ville">Town* :</label><input type="text" name="ville" id="ville" <?php echo 'value='.$tabResultat[0]['ville']?>></p>

			<p><label for="zip">Postal code* :</label><input type="text" name="zip" id="zip" <?php echo 'value='.$tabResultat[0]['zip']?>></p>

			<p><label for="etat">Province/State :</label><input type="text" name="etat" id="etat" <?php echo 'value='.$tabResultat[0]['etat']?>></p>

			<p><label for="pays">Country* :</label>
							
				 <select id="pays" name="pays">
				<?php 
				
				 foreach($paysEn as $pays){
					if($tabResultat[0]['pays']==$pays)
						echo ' <option value="'.$pays.'" selected>'.$pays.'</option>';
					else
						echo ' <option value="'.$pays.'">'.$pays.'</option>';
				 }
				 ?>
				 </select>

			</p>

			<p><label for="mobile">Personal phone n° (International format, i.e. with country code)* :</label>
				<input type="tel" name="mobile" id="mobile" <?php echo 'value='.$tabResultat[0]['mobile']?> >
			</p>

			<p><label for="tel">International(professional) phone :</label><input type="tel" name="tel" id="tel" <?php echo 'value='.$tabResultat[0]['tel']?> ></p>

			<p><label for="nationalite">Country of citizenship(internationnal code)* :</label>
				
				 <select id="nationalite" name="nationalite">
				 <?php 
				 foreach($codeNationEn as $pays){
				 if($tabResultat[0]['nationalite']==$pays)
					echo ' <option value="'.$pays.'" selected>'.$pays.'</option>';
				 else
					echo ' <option value="'.$pays.'">'.$pays.'</option>';
				 }
				 ?>
				 </select>
			</p>

			<p><label for="nb_resume">Number of abstracts to submit(only one as a presenting author)* :</label>
				<input type="number" name="nb_resume" id="nb_resume" <?php echo 'value='.$tabResultat[0]['nb_resume']?> >
			</p>

			<p><label for="alimentation">Food request :</label>
				<select name="alimentation" id="alimentation">
					<option value="Halal" <?php echo 'value='.$tabResultat[0]['alimentation']?>>Halal</option>
					<option value="Cacher" <?php echo 'value='.$tabResultat[0]['alimentation']?>>Kosher</option>
					<option value="Végétarienne" <?php echo 'value='.$tabResultat[0]['alimentation']?> >Vegetarian</option>
					<option value="Indifférent" <?php echo 'value='.$tabResultat[0]['alimentation']?>>Indifferent</option>
				</select>
			</p>

			<p><label for="intolerance">Food inability :</label>
				<label for="Gluten">Gluten</label><input type="checkbox" name="gluten" value="Gluten" id="gluten" <?php if(($tabResultat[0]['intolerance']!='Lactose')||($tabResultat[0]['intolerance']=='Gluten')) echo 'checked'   ?> />
				<label for="Lactose">Lactose</label><input type="checkbox" name="lactose" value="Lactose" id="lactose" <?php if(($tabResultat[0]['intolerance']=='Lactose')||($tabResultat[0]['intolerance']!='Gluten')) echo 'checked'  ?> />
			</p>

			<input type="button" value="next" id="next">

		
	</div>

	<div id="page2">
	Thanks for blablabla 
	Click on the link below to submit your inscription and send email ...
		<input type="submit" value="Valider" id="submit">
		</form>
	</div>
	
	<div id="page3">
		Merci !
	</div>

		
</body> 
	<style type="text/css">
	
	.boutonAvancement{
 width: 100px;
 height: 50px;
 border-radius: 25px;
 text-align:center;
 display : inline-block;
background-color: #F2CA7E;
color : white;
overflow: hidden;
position: relative;
margin-right:50px;
}
	

	</style>
</html>